<template>
  <view>

    <view>用户名:<input type="text" placeholder="请输入用户名" v-model="userName" /></view>
    <view>密码:<input type="password" placeholder="请输入密码" v-model="password" /></view>
    <button type="default" @click="doLogin()">登录</button>

  </view>
</template>

<script>
  export default {
    data() {
      return {
        userName: "",
        password: ""
      };
    },
    methods: {
      doLogin() {
        console.log('==========================')
        if (this.userName.trim() == '') {
          uni.showToast({
            title: "请输入用户名",
            duration: 2000,
            icon: "none"
          });
          return;
        }
        if (this.password.trim() == '') {
          uni.showToast({
            title: "请输入密码",
            duration: 2000,
            icon: "none"
          });
          return;
        }

      }
    }
  }
</script>

<style lang="scss">

</style>